const express = require('express')
const app = express()

app.get('/', (req, res) => {
  throw new Error('服务器内部发生了错误')
  res.send('get request')
})
app.use((err, req, res, next) => {
  console.log('error:' + err.message);
  res.send('error:' + err.message)
})



app.listen(8089, () => {
  console.log('服务器启动成功');
})